﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace _0712502_0712504_DesignPatternGame
{
    public class BulletFactory : GameEntityFactory
    {
        BulletLevel1 bulletLevel1;
        BulletLevel2 bulletLevel2;
        BulletLevel3 bulletLevel3;

        public override void InitPrototypes()
        {
            _nprototype = 4;
            _prototypes = new VisibleGameEntity[_nprototype];


            _prototypes[0] = new BulletLevel1();
            _prototypes[1] = new BulletLevel2();
            _prototypes[2] = new BulletLevel3();

        }

        public override VisibleGameEntity CreateObject(int idx)
        {
            if ((idx < 0) || (idx >= _nprototype))
            {
                return null;
            }

            return _prototypes[idx].Clone();
        }
    }
}
